
<input type="text" #name>
<input type="text" #age>
<button (click)="addUser(name.value,age.value)">addUser</button>

<table>
	<tr *ngFor="let u of users" (click)="selectUser(u)">
		<td>{{u.id}}</td>
		<td>{{u.name}}</td>
		<td>{{u.age}}</td>
		<td><button (click)="deleteUser(u.id);$event.stopPropagation();">delete</button></td>
	</tr>
</table>
<div *ngIf="currentUser">
<input [(ngModel)]="currentUser.name" type="text">
<input [(ngModel)]="currentUser.age" type="text">
<button (click)="updateUser(currentUser)">update</button>
</div>